function getIcon(file){
    //获取文件扩展名
    if (file){
            let ext = file.split('.').pop();
            extIconList = {
                'jpg': 'fa-file-image-o',
                'png': 'fa-file-image-o',
                'gif': 'fa-file-image-o',
                'jpeg': 'fa-file-image-o',
                'bmp': 'fa-file-image-o',
                'ico': 'fa-file-image-o',
                'svg': 'fa-file-image-o',
                'pdf': 'fa-file-pdf-o',
                'doc': 'fa-file-word-o',
                'docx': 'fa-file-word-o',
                'xls': 'fa-file-excel-o',
                'xlsx': 'fa-file-excel-o',
                'ppt': 'fa-file-powerpoint-o',
                'pptx': 'fa-file-powerpoint-o',  
                'mp3': 'fa-file-audio-o',
                'wav': 'fa-file-audio-o',
                'mp4': 'fa-file-video-o',
                'avi': 'fa-file-video-o',
                'rmvb': 'fa-file-video-o',
                'rm': 'fa-file-video-o',
                'flv': 'fa-file-video-o',
                'zip': 'fa-file-archive-o',
                'rar': 'fa-file-archive-o',
                '7z': 'fa-file-archive-o',
                'tar': 'fa-file-archive-o',
                'gz': 'fa-file-archive-o',
                'bz2': 'fa-file-archive-o',
                'tar.gz': 'fa-file-archive-o',
                'bz': 'fa-file-archive-o',
                'tar.bz2': 'fa-file-archive-o',
                'tar.xz': 'fa-file-archive-o',
                'xz': 'fa-file-archive-o',
                'exe': 'fa-file-code-o',
                'apk': 'fa-file-code-o',
                'css': 'fa-file-code-o',
                'html': 'fa-file-code-o',
                'php': 'fa-file-code-o',
                'py': 'fa-file-code-o',
                'java': 'fa-file-code-o',
                'c': 'fa-file-code-o',
                'cpp': 'fa-file-code-o',
                'js': 'fa-file-code-o',
                'json': 'fa-file-code-o',
                'sql': 'fa-file-code-o',
                'txt': 'fa-file-text-o',
                'log': 'fa-file-text-o',
                'md': 'fa-file-text-o',
        }

        if (extIconList[ext]){
            return extIconList[ext];
        }else{
            return 'fa-file-o';
        }
    }
}

//判断文件是不是图片
function isImage(file){
    let ext = file.split('.').pop();
    let imgExtList = ['jpg', 'png', 'gif', 'jpeg', 'bmp', 'ico', 'svg'];
    return imgExtList.indexOf(ext) > -1;
}


export default {
    getIcon,
    isImage
}